<?php
/**
 * 系统标签类
 * @Author hugo
 * @Email webmaster@jushare.com
 */
namespace Common\TagLib;
use Think\Template\TagLib;

class Input extends TagLib
{
    // 标签定义
    protected $tags   =  array(
        // 标签定义： attr 属性列表 close 是否闭合（0 或者1 默认1） alias 标签别名 level 嵌套层次
        'show' => array('attr'=>'id,name,style,width,height,type,value,select', 'close' => 1),
    );

    public function _show($tag,$content = '') {
        $id = $tag['id'];
        $name = trim($tag['name']);
        $style = trim($tag['style']);
        $width = trim($tag['width']);
        $height = trim($tag['height']);
        $type = strtolower($tag['type']);
        $parseStr = array(
            'textarea' => '<textarea id="[id]" name="[name]" class="easyui-validatebox input-text" style="width: 500px; height: 30px; [style]">[value]</textarea>',
            'text' => '<input type="text" id="[id]" name="[name]" class="easyui-validatebox input-text" size="45" value="[value]">',
            'images' => '<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="chooseImages(this)">选择</a>'
        );
        var_dump($type);
        return $type;
        $parseStr = $parseStr[$type];
        $parseStr = str_replace(array('[id]', '[name]', '[style]', '[width]', '[height]'), array($id, $name, $style, $width, $height), $parseStr);
        return $parseStr;
    }
}